/**
 * 调试重试机制的工具
 */

import { requestQueue } from './requestQueue';
import { retryEventBus } from './retryEventBus';
import axiosInstance from './axios.config';

// 检查重试队列状态
export function checkRetryQueueStatus() {
  console.log('=== 重试队列状态检查 ===');
  console.log('队列长度:', requestQueue.getQueueLength());
  console.log('重试事件:', retryEventBus.getRetryEvents());
}

// 手动触发重试
export async function manualTriggerRetry() {
  console.log('手动触发重试...');
  try {
    await requestQueue.retryAllRequests(axiosInstance);
    console.log('手动重试完成');
  } catch (error) {
    console.error('手动重试失败:', error);
  }
}

// 清空重试队列
export function clearRetryQueue() {
  console.log('清空重试队列...');
  requestQueue.clearQueue();
  console.log('重试队列已清空');
}
